import threading
import time


def a():
    for i in range(1,11):
        print(i)
        time.sleep(1)

def b():
    for i in ["a","b","c","d","e","f","h","i","j","k"]:
        print(i)
        time.sleep(1)

# 创建类 继承线程父类
class MyThread(threading.Thread):

    def run(self): # 重写任务函数 run函数
        for i in range(1,11):
            print(self.name,i)

if __name__ == '__main__':
    # 创建一个线程可以执行run
    thread1 = threading.Thread(target=a)
    # 创建一个线程可以执行run2
    thread2 = threading.Thread(target=b)
    # 启动线程
    thread1.start()
    thread2.start()



